function main(tbl){
	if(req.contentType!=null&&req.contentType.indexOf("json") != -1){
		try {
			tbl=foJson(reqBody())
			attr("tbl",tbl)
		} catch (e) {
		}
	}
	if(isEmpty(tbl.appid)){
		attr(":json",true)
		return {"code":10001,"msg":"appid为空"}
	}
	if(isEmpty(tbl.appkey)){
		attr(":json",true)
		return {"code":10002,"msg":"appkey为空"}
	}
	let u=dao.fetch(`select u.*,b.id as 'bid',b.type,b.num,b.cxnum,b.conf from app_user u,app_buy b where u.id=b.uid
		and appid='${tbl.appid}' and appkey='${tbl.appkey}'`)
	if(u==null){
		attr(":json",true)
		return {"code":10003,"msg":"账号错误"}
	}else{
		if(u.type!=req.servletPath){
			attr(":json",true)
			return {"code":10004,"msg":"该账号无该接口权限"}
		}else if((u.num-u.cxnum)>0){
			attr("u",u)
			return "chain";
		}else{
			return {"code":10005,"msg":"你的查询次数已用完"}
		}
	}
}